package com.sgb.kjwl.view.widget.map;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sgb.kjwl.R;
import com.swgk.core.dialog.BaseBottomDialog;
import com.swgk.core.dialog.DialogViewHolder;

public class MapNavigationDialog3 extends BaseBottomDialog {
    private LinearLayout gaodeLayout;
    private LinearLayout tengxunLayout;
    private LinearLayout baiduLayout;
    private TextView cancelView;
    private DialogClickCallBack dialogClickCallBack;

    public MapNavigationDialog3(Context context, DialogCallBack dialogCallBack) {
        super(context, dialogCallBack);
    }

    public MapNavigationDialog3(Context context, int theme, DialogCallBack dialogCallBack) {
        super(context, theme, dialogCallBack);
    }

    @Override
    protected int dialogLayout() {
        return R.layout.packer_map_navigation_dialog3;
    }

    @Override
    protected void initView(DialogViewHolder holder, Bundle savedInstanceState) {
        gaodeLayout = holder.getDialog().findViewById(R.id.gaode_layout);
        tengxunLayout = holder.getDialog().findViewById(R.id.tengxun_layout);
        baiduLayout = holder.getDialog().findViewById(R.id.baidu_layout);
        cancelView = holder.getDialog().findViewById(R.id.cancel_view);
        cancelView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        gaodeLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (dialogClickCallBack != null) {
                    dialogClickCallBack.onClickGaoDe();
                }
            }
        });
        tengxunLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (dialogClickCallBack != null) {
                    dialogClickCallBack.onClickTenXun();
                }
            }
        });
        baiduLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (dialogClickCallBack != null) {
                    dialogClickCallBack.onClickBaiDu();
                }
            }
        });
    }

    public interface DialogClickCallBack {
        void onClickBaiDu();
        void onClickGaoDe();
        void onClickTenXun();
    }

    public MapNavigationDialog3 setDialogClickCallBack(DialogClickCallBack dialogClickCallBack) {
        this.dialogClickCallBack = dialogClickCallBack;
        return this;
    }
}
